var path = require('path');
var webpack = require('../webpack');
module.exports = {
    entry: path.join(__dirname, './src/index.js'),
    mode: 'development',
    output: {
        path: path.join(__dirname, 'dist'),
        filename: 'dist.js'
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                loader: path.join(__dirname, '/loader/test-loader')
            },
            {
                test: /\.css$/,
                loader: path.join(__dirname, '../style-loader')
            }
        ]
    },
    plugins: [
        new webpack.ProvidePlugin({
            classnames: 'classnames'
        }),
        new webpack.NamedModulesPlugin()
    ],
    optimization: {
        splitChunks: {
            cacheGroups: {
                commons: {
                  test: /[\\/]node_modules[\\/]/,
                  name: 'vendors',
                  chunks: 'all',
                  minSize: 2
                }
            }
        }
    }
}